package com.block.common.service.impl;

import com.block.common.config.AliIPConfig;
import com.block.common.constant.AppRspCodeConstant;
import com.block.common.model.vo.ReqIpInfoVO;
import com.block.common.service.IIpInfoService;
import com.block.common.util.ALiIpUtil;
import com.block.common.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IpInfoServiceImpl implements IIpInfoService {

    @Autowired
    AliIPConfig aliIPConfig;

    @Override
    public ResponseVo getIpInfoResult(String ipAddr){
        ReqIpInfoVO reqIpAreaInfo = ALiIpUtil.getReqIpAreaInfo(ipAddr, aliIPConfig.getAppCode());
        return new ResponseVo(AppRspCodeConstant.SUCCESS, reqIpAreaInfo);
    }

}
